<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta charset="UTF-8">
		<title>注册</title>
		<link rel="stylesheet" type="text/css" href="<%=basePath%>frontPage/css/public.css"/>
		<link rel="stylesheet" type="text/css" href="<%=basePath%>frontPage/css/login.css"/>
		<script type="text/javascript" src="<%=basePath%>frontPage/js/jquery-1.12.4.min.js"></script>
	</head>
	<body>
		<!-------------------reg-------------------------->
		<div class="reg">
			<form action="<%=basePath %>front/add" method="post" style="width: 439px;height: 549px;" id=registerId>
 				<p>用户注册</p>
 				<p><input type="hidden" name="isAdmin" value="0"></p>
				<p>用&nbsp;户&nbsp;名&nbsp;:<input type="text" name="name" value="" ></p>
				<p>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别&nbsp;:<input type="text" name="gender" value="" ></p>
				<p>联&nbsp;系方式:<input type="text" name="phone" value="" ></p>
				<p>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码:<input type="password" name="loginPassword" value=""></p>
				<p>重复&nbsp;&nbsp;密码:<input type="password" name="loginPasswords" value="" ></p>
				<p>验证码:<input type="text" name="image" style="width: 200px"><img alt="" src="/market/VerifyCodeServlet"></p>
				<p><input type="button" value="看不清？换一张" id="btn" >
					<font color="red">${requestScope.imageMess}</font>
				</p>
				<p><input type="submit" name=""  value="注册"></p>
				<p class="txtL txt">完成此注册，即表明您同意了我们的<a href="#"><使用条款和隐私策略></a></p>
				<p class="txt"><a href="login.jsp"><span></span>已有账号登录</a></p>
			</form>
		</div>
		<script type="text/javascript">
			document.getElementById("btn").onclick = function () {
		        // 获取img元素
		        // 为了让浏览器发送请求到servlet, 所以一定要改变src
		        document.getElementsByTagName("img")[0].src =
		            "/market/VerifyCodeServlet?time=" + new Date().getTime();
		    };
		</script>
	</body>
</html>
